{include file="common/top" /}
<link  type="text/css" href="__static/ossupload/style.css"/>
<style>
html{
	background: #ffffff;
}
</style>

<form class="layui-form " action="" style="    background: #fff;">
	{eq name="re.type" value="1"}
		<table class="layui-table">
		  <tbody>
		    <tr>
		      <td style="width:13%">客户名称：</td>
		      <td style="width:25%">{$rs.name}</td>
		      <td style="width:15%">打款金额：</td>
		      <td >{$re.amount}</td>
		    </tr>
		    <tr>
		      <td>公司卡号：</td>
		      <td>{$gs_bank.num}</td>
		      <td>开户行地址：</td>
		      <td>{$gs_bank.bank_address}</td>
		    </tr>
		    
		  </tbody>
		</table>
		<hr/>
		<div class="layui-form-item">
			<label class="layui-form-label">是否垫款：</label>
			<div class="layui-col-xs8">
				{:$re['is_advance']?'<span class="layui-badge">是</span>':'<span class="layui-badge layui-bg-gray">否</span>'}
			</div>
		</div>
	{/eq}
	{eq name="re.type" value="2"}
		<table class="layui-table">
		  <tbody>
		    <tr>
		      <td style="width:13%">渠道名称：</td>
		      <td style="width:25%">{$arr['channel_name']}</td>
		      <td style="width:15%">账户ID：</td>
		      <td >{$arr['acc_name']}</td>
		    </tr>
		    <tr>
		      <td style="width:15%">充值账户币：</td>
		      <td >{$re.currency}</td>
		      <td style="width:15%">渠道金额：</td>
		      <td >{$re.channel_money}</td>
			</tr>
			<tr>
				<td style="width:15%">客户名称：</td>
				<td >{$rs.name}</td>
				<td style="width:15%">余额(元)：</td>
				<td style="color: red; font-weight: bold;">{$rs.prepare_money}</td>
			</tr>
		  </tbody>
		</table>
	{/eq}
	{eq name="re.type" value="3"}
		<table class="layui-table">
		  <tbody>
		    <tr>
		      <td style="width:13%">客户名称：</td>
		      <td style="width:25%">{$rs.name}</td>
		      <td style="width:15%">退款金额：</td>
		      <td >{$re.amount}</td>
		    </tr>
		    <tr>
		      <td>银行卡信息：</td>
		      <td colspan="3">{$re.cardholder}</td>
		    </tr>
		  </tbody>
		</table>
	{/eq}
	
	{eq name="re['is_advance']" value="0"}
		<div class="layui-form-item">
			<label class="layui-form-label">上传凭证：</label>
			<div class="layui-col-xs4">
				<div class="layui-upload-drag" id="test10">
				  	<i class="layui-icon"></i>
				  	<p>点击上传，或将文件拖拽到此处</p>
				  	<div class="{:$re['audit_proof_url']?'':'layui-hide'}" id="uploadDemoView">
				  		<hr>
				    	<img src="{$re.audit_proof_url}" alt="上传成功后渲染" style="max-width: 196px">
				  	</div>
				</div>
			</div>
			
		</div>
	{/eq}
	
	<!-- <div class="layui-form-item">
		<label class="layui-form-label">备注：</label>
		<div class="layui-col-xs8">
			<textarea name="note" autocomplete="off" placeholder="请输入详细备注" class="layui-textarea"></textarea>
		</div>
	</div> -->
	<hr />
	<div class="layui-form-item">
		<div class="layui-input-block">
			<input type="hidden"  name="id" value="{$Request.get.id}">
			<input type="hidden"  name="is_advance" value="{$re.is_advance}">
			<input type="hidden" id='image'  name="audit_proof_url" value="{$re.audit_proof_url}">
			<button class="layui-btn"  lay-submit="" lay-filter="demo1">提交</button>
		</div>
	</div>
	
</form>
{include file="common/footer" /}
<script>
	layui.use(['form', 'layedit', 'laydate','upload'], function(){
		  var form = layui.form ,layer = layui.layer,upload = layui.upload,$ = layui.jquery;
		  //监听提交
		  form.on('submit(demo1)', function(data){
			var articleFrom = data.field;
			layer.load(1, { shade : [ 0.5, '#676a6c' ] }); 
			$.post("{:url('audit')}?t=json",articleFrom,function(data){
				layer.closeAll();
				if (data['code'] == 1) { 
					var index1 = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					parent.layer.close(index1); //再执行关闭 
					//父页面数据 ，重新加载
					parent.get_apply(data['msg']);
				} else {
					layer.msg(data['msg'], { icon : 5 });
				}
			});
			return false;
		  });
		//拖拽上传
		upload.render({
		    elem: '#test10'
		    ,url: '{:url("Upload/index")}' //改成您自己的上传接口
		    ,exts: 'jpg|png|jpeg|gif'
	    	,choose: function(obj){
	    		layer.load(1, { shade : [ 0.5, '#676a6c' ] });
	    	}
		    ,done: function(res){
		    	layer.closeAll();
		    	if(res.code == 0){
		    		layer.msg('上传成功');
				    layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', res.data);
				    $("input[name=audit_proof_url]").val(res.data);
		    	}else{
		    		layer.msg(res.msg);
		    	}
		      
		      //console.log(res)
		    }
		  });
		  
		});
	
	
</script>
